import "./assets/main.css";

import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

const app = createApp(App);

app.use(router);

app.use(ElementPlus);

app.mount("#app");

(function rem() {
  let dw = 1920; // 设计图宽度
  let sw = window.innerWidth; // 屏幕宽度
  let fontSize = (sw / dw) * 10;
  let oHtml = document.getElementsByTagName("html")[0];
  oHtml.style.fontSize = fontSize + "px";
  const boundary = () => {
    if (sw >= 1536) {
      oHtml.style.fontSize = "10px";
    }
    // if (sw < 300) {
    //   oHtml.style.fontSize = 4 + 'px'
    // }
  };
  boundary();
  window.onresize = function () {
    rem();
    boundary();
  };
})();
